package v1

import (
	"github.com/gogf/gf/v2/frame/g"
	"learn-goframe/api/v1/common"
	"learn-goframe/internal/repository/xtcloud-file/entity"
)

type SolutionListReq struct {
	g.Meta `path:"/list" tags:"Solution" method:"get" summary:"解决方案列表"`

	common.PaginationReq

	Status int `json:"status" d:"0" v:"required|in:0,1,2,3,4"  in:"" dc:"状态"`
}

type SolutionListRes struct {
	common.PaginationRes

	List []*entity.ProjectSolution `json:"list" description:"列表"`
}

type SolutionSaveReq struct {
	g.Meta `path:"/save" tags:"Solution" method:"post" summary:"保存解决方案"`

	CategoryId        string `json:"categoryId" dc:"分类id" v:"required#分类id不能为空"`
	CategoryParentId  string `json:"categoryParentId" dc:"分类父id" v:"required#分类父id不能为空"`
	SolutionName      string `json:"solutionName"      dc:"方案名称" v:"required#方案名称不能为空"`
	SolutionImgUrl    string `json:"solutionImgUrl"    dc:"方案图片" v:"required|url#方案图片不能为空|url格式不正确"`
	SolutionSummarize string `json:"solutionSummarize" dc:"方案概述" v:"required#方案概述不能为空"`
	SolutionFileUrl   string `json:"solutionFileUrl"   dc:"方案文件" v:"required|url#方案文件不能为空|url格式不正确"`
	Status            int    `json:"status"            dc:"状态" v:"required|in:1,4#状态不能为空"`

	Id string `json:"id"                dc:"方案id"`
}

type SolutionSaveRes struct {
	Id string `json:"id" dc:"方案id"`
}

type SolutionRollbackReq struct {
	g.Meta `path:"/rollback" tags:"Solution" method:"post" summary:"回滚解决方案"`

	Id string `json:"id" dc:"方案id" v:"required#方案id不能为空"`
}

type SolutionRollbackRes struct {
}

type SolutionSubmitReq struct {
	g.Meta `path:"/submit" tags:"Solution" method:"post" summary:"提交解决方案"`

	Id string `json:"id" dc:"方案id" v:"required#方案id不能为空"`
}

type SolutionSubmitRes struct {
}

type SolutionDeleteReq struct {
	g.Meta `path:"/delete" tags:"Solution" method:"post" summary:"删除解决方案"`

	Id string `json:"id" dc:"方案id" v:"required#方案id不能为空"`
}

type SolutionDeleteRes struct {
}

type CertInfoReq struct {
	g.Meta `path:"/certInfo" tags:"Solution" method:"get" summary:"开发者认证情况"`
}

type CertInfoRes struct {
	CertType int `json:"certType" description:"认证类型，1=个人认证，2=企业认证"`

	RelName          string `json:"relName" description:"个人开发者姓名"`
	OrgName          string `json:"orgName"          description:"企业名称"`
	ContactMobile    string `json:"contactMobile"    description:"手机号"`
	OrgLicenseImgUrl string `json:"orgLicenseImgUrl" description:"企业营业执照"`
}
